<template>
  <div>
    <!-- 顶部区域 -->
    <div class="wel__header">
      <div class="wel__info">
        <img :src="userinfo.headIcon" alt class="wel__info-img" />
        <div class="wel__info-content">
          <div class="wel__info-title">
            {{ this.userinfo.realName }}, 欢迎登入系统~
          </div>
          <div class="wel__info-subtitle">工号：{{ this.userinfo.enCode }}</div>
        </div>
      </div>
      <div class="wel__extra">
        <div class="wel__extra-item">
          <p class="wel__extra-title">登录次数</p>
          <p class="wel__extra-subtitle">56</p>
        </div>
        <!-- <div class="wel__extra-item">
          <p class="wel__extra-title">Team ranking</p>
          <p class="wel__extra-subtitle">
            8
            <span>/ 24</span>
          </p>
        </div> -->
        <div class="wel__extra-item">
          <p class="wel__extra-title">最近登录时间</p>
          <p class="wel__extra-subtitle">2020-09-23 23:31:00</p>
        </div>
      </div>
    </div>
    <br />
    <!-- DataBox 数据展示 -->
    <avue-data-box :option="boxOption"></avue-data-box>
    <br />
    <el-row :span="24">
      <el-col :span="18">
        <!-- DataProgress 数据展示 -->
        <avue-data-progress
          :option="progressOption"
          style="margin-bottom: 35px"
        ></avue-data-progress>
        <!-- DataTabs 数据展示 -->
        <avue-data-tabs :option="tabsOption"></avue-data-tabs>
      </el-col>
      <el-col :span="6">
        <!-- DataIcons 数据展示 -->
        <avue-data-icons :option="iconsOption"></avue-data-icons>
      </el-col>
    </el-row>
    <br />
    <!-- 数据表格 -->
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "wel",
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["userinfo"]),
    boxOption() {
      return {
        span: 6,
        data: [
          {
            title: "Error Log",
            count: 12332,
            icon: "el-icon-warning",
            color: "rgb(49, 180, 141)",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Data display",
            count: 33,
            icon: "el-icon-view",
            color: "rgb(56, 161, 242)",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Privilege management",
            count: 2223,
            icon: "el-icon-setting",
            color: "rgb(117, 56, 199)",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "user management",
            count: 2223,
            icon: "el-icon-setting",
            color: "rgb(230, 71, 88)",
            href: "https://avuejs.com",
            target: "_blank",
          },
        ],
      };
    },
    progressOption() {
      return {
        span: 8,
        data: [
          {
            title: "Conversion rate (Day 28%)",
            color: "rgb(178, 159, 255)",
            count: 32,
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Attendance rate (Day 11%)",
            color: "rgb(230, 71, 88)",
            count: 32,
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Attendance rate (Day 33%)",
            color: "rgb(230, 71, 88)",
            count: 32,
            href: "https://avuejs.com",
            target: "_blank",
          },
        ],
      };
    },
    iconsOption() {
      return {
        span: 12,
        data: [
          {
            title: "Registration today",
            count: 12678,
            icon: "el-icon-tickets",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Login today",
            count: 22139,
            icon: "el-icon-success",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Subscription today",
            count: 35623,
            icon: "el-icon-info",
            href: "https://avuejs.com",
            target: "_blank",
          },
          {
            title: "Todays review",
            count: 16826,
            icon: "el-icon-message",
            href: "https://avuejs.com",
            target: "_blank",
          },
        ],
      };
    },
    tabsOption() {
      return {
        span: 8,
        data: [
          {
            title: "Classified statistics",
            subtitle: "real time",
            count: 7993,
            allcount: 10222,
            text: "Total Record Number of Classifications",
            color: "rgb(27, 201, 142)",
            key: "A",
          },
          {
            title: "Classified statistics",
            subtitle: "real time",
            count: 3112,
            allcount: 10222,
            text: "Total Record Number of Classifications",
            color: "rgb(230, 71, 88)",
            key: "B",
          },
          {
            title: "Classified statistics",
            subtitle: "real time",
            count: 908,
            allcount: 10222,
            text: "Total Record Number of Classifications",
            color: "rgb(56, 161, 242)",
            key: "C",
          },
        ],
      };
    },
  },
  created() {},
  methods: {},
};
</script>

<style lang="less" scoped>
.wel {
  &__header {
    padding: 25px 40px;
    border-bottom: 1px solid #e8e8e8;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  &__info {
    display: flex;
    align-items: center;
    &-img {
      border-radius: 72px;
      display: block;
      width: 72px;
      height: 72px;
      img {
        width: 100%;
        height: 100%;
        display: block;
      }
    }
    &-content {
      position: relative;
      margin-left: 24px;
      color: rgba(0, 0, 0, 0.45);
      line-height: 22px;
    }
    &-title {
      font-size: 20px;
      line-height: 28px;
      font-weight: 500;
      color: rgba(0, 0, 0, 0.85);
      margin-bottom: 12px;
    }
    &-subtitle {
      position: relative;
      font-size: 14px;
      color: rgba(0, 0, 0, 0.45);
      line-height: 22px;
    }
  }
  &__extra {
    &-item {
      position: relative;
      padding: 0 32px;
      display: inline-block;
      &:last-child {
        &::after {
          display: none;
        }
      }
      &:after {
        background-color: #e8e8e8;
        position: absolute;
        top: 30px;
        right: 0;
        width: 1px;
        height: 40px;
        content: "";
      }
    }
    &-title {
      color: rgba(0, 0, 0, 0.45);
      font-size: 14px;
      line-height: 22px;
      margin-bottom: 4px;
    }
    &-subtitle {
      color: rgba(0, 0, 0, 0.85);
      font-size: 30px;
      line-height: 38px;
      margin: 0;
      span {
        color: rgba(0, 0, 0, 0.45);
        font-size: 20px;
      }
    }
  }
}
</style>
